package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FisDemo {
    public static void main(String[] args){
        try(
                FileInputStream fis = new FileInputStream("asd.bat")
        ) {
            int a=0;
            while (true) {
                if (fis.read() == -1) {
                    break;
                } else {
                    a = a+fis.read();
                    System.out.println(a);
                }
            }
            System.out.println(a);
        } catch (IOException e) {}
    }
}
